#!/bin/bash
# github.com/tintinweb

REPO_ARCHIVE="https://android.googlesource.com/platform/system/core/+archive/master/libnetutils.tar.gz"


echo "[i] downloading libnetutils ..."
wget -O ./tmp.tgz $REPO_ARCHIVE
tar xvfz tmp.tgz
rm -f tmp.tgz
echo
echo "[i] ---> Building the PoC"
gcc -g -DVERBOSE -o sniff_poc sniffer.c packet.c dhcpmsg.c -lrt
echo
echo
if [ "$?" -eq "0" ]; then
    echo "[i] ---> All done!"
    echo "         now just run #> sudo ./sniff_poc <interface>"
else
    echo "[!] ---> Build failed!"
    echo "         check for errors!"
fi 
